package com.example.aerospacemanagementsystem.controller.basic;

import com.example.aerospacemanagementsystem.entity.basic.Department;
import com.example.aerospacemanagementsystem.entity.basic.Job;
import com.example.aerospacemanagementsystem.service.basicService.JobService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 铁殷
 */

@Api(tags = "职务")
@RestController
@CrossOrigin
@RequestMapping("/job")
public class JobController {

    @Autowired
    private JobService jobService;
    //添加职务
    @PostMapping
    public int add(@RequestBody Job job){
        return jobService.add(job);
    }
    //删除职务
    @DeleteMapping
    public int delete(Job job){
        return jobService.delete(job);
    }
    //修改职务
    @PutMapping
    public int update(@RequestBody Job job){
        return jobService.update(job);
    }
    //获取职务
    @GetMapping("/getAll")
    public List<Job> getAllCity(Job job) {
        List<Job> list = jobService.getAllJob(job);
        return list;
    }
}
